#include <string>
#include "../NS/nameserver.h"
#include "../Headers/types.h"
#include "authorizationsrv.h"
#include "ar.rpc.h"

result *checkpolicy_1_svc(policyParam *argp, struct svc_req *rqstp)
{
	static result out;
  TOB::AuthorizationSRV auth((TOB::Nameserver::IP)argp->req.nsip, 
      std::string(argp->req.username),
      std::string(argp->req.password));
  out.code = auth.policy((Policy::Type)argp->param, (bool&)out.result);
	return &out;
}

result *checkrole_1_svc(roleParam *argp, struct svc_req *rqstp)
{
	static result out;
  TOB::AuthorizationSRV auth((TOB::Nameserver::IP)argp->req.nsip, 
      std::string(argp->req.username),
      std::string(argp->req.password));
  out.code = auth.role((Role::Type)argp->param, (bool&)out.result);
	return &out;
}
